package com.hongxun.design.jungong.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.hongxun.design.constant.Constant;

import java.util.List;

/**
 * Created by Administrator on 2017/8/4.
 */

public abstract class myBaseAdapter<T extends Object> extends BaseAdapter {
    public List<T> tList;
    public Activity activity;
    public LayoutInflater inflater;

    public myBaseAdapter(Activity activity, List<T> tList) {
        this.tList = tList;
        this.activity = activity;
        this.inflater=LayoutInflater.from(activity);
    }

    @Override
    public int getCount() {
        return tList.size();
    }

    @Override
    public T getItem(int position) {
        return tList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return getV(position, convertView, getItem(position));
    }

    public abstract View getV(int position, View convertView, T obj);

}
